<?php echo $html->script('valesalidas/get_valesalida.js'); ?>
<div id="facturaDialog" class="hide">
	<h2 id="summary"></h2>
	<?php echo $form->hidden('Valesalida.valesalidaestado_id',array('value'=>$valesalida['Valesalida']['valesalidaestado_id'])); ?>
	<?php echo $form->hidden('Valesalida.id',array('value'=>$vale_id)); ?>
	<table class="tablaFormHeader"><?php echo
		'<tr>'
			.'<td><div class="span-3">'.__('Numero Factura', true).'</div></td>'
			.'<td><div class="span-10">:&nbsp;'.$valesalida['Factura']['numero'].'</div></td>'
			
			.'<td>'.__('Fecha', true).'</td>'
			.'<td>:&nbsp;'.substr($valesalida['Factura']['created'],0,10).'</td>'
		.'</tr>'
		
		.'<tr>'
			.'<td>'.__('Numero Vale', true).'</td>'
			.'<td>:&nbsp;'.$valesalida['Valesalida']['numero'].'</td>'
			
			.'<td>'.__('Almacen', true).'&nbsp;&nbsp;&nbsp;</td>'
			.'<td>:&nbsp;'.$valesalida['Almacen']['codigo'].'</td>'
		.'</tr>'
		
		.'<tr>'
			.'<td>'.__('Entregado por', true).'</td>'
			.'<td>:&nbsp;'.$valesalida['Usuario']['appaterno'].' '.$valesalida['Usuario']['nombres'].'</td>'
			
			.'<td></td>'
			.'<td></td>'
		.'</tr>'; ?>
	</table>

	<br/>
	<div class="span-15">
		<table id="detallevale" class="tablaForm tablaFormInput">
			<thead>
				<tr>
					<th class="header"><div class="span-2">Codigo</div></th>
					<th class="header"><div class="span-7">Descripcion</div></th>
					<th class="header"><div class="span-2">Und x Cj</div></th>
					<th class="header"><div class="span-3">Unidad</div></th>
					<th class="header"><div class="span-3">Cantidad</div></th>
				</tr>	
			</thead>
			<tbody><?php
			foreach($detallevalesalida as $detallevale):	
			echo
		 	'<tr class="ui-widget-content jqgrow ui-row-ltr">'
				.'<td class="text_center">'.$detallevale['Articulo']['codigo'].'</td>'
				.'<td>'.$detallevale['Articulo']['descripcion'].'</td>'
				.'<td class="text_right">'.$detallevale['Articulo']['unidadxcaja'].'</td>'
				.'<td>'.$detallevale['Unidad']['descripcion'].'</td>'
				.'<td class="text_right">'.$detallevale['Detallevalesalida']['cantidad'].'</td>'
			.'</tr>';
			endforeach;
			?></tbody>
		</table>
	</div>	
</div>